<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
| Version 1.0
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::get('demo', [\App\Http\Controllers\Api\v1\DemoController::class, 'demo']);// 示例接口

// 微信小程序登录
Route::post('passport/mobileLogin', [\App\Http\Controllers\Api\v1\PassportController::class, 'mobileLogin']);// 手机号验证码登录注册
Route::post('passport/mobileRegister', [\App\Http\Controllers\Api\v1\PassportController::class, 'mobileRegister']);// 手机号验证码注册
Route::post('passport/login', [\App\Http\Controllers\Api\v1\PassportController::class, 'login']);// 账号密码登录
Route::post('passport/register', [\App\Http\Controllers\Api\v1\PassportController::class, 'register']);
Route::post('passport/thirdLogin', [\App\Http\Controllers\Api\v1\PassportController::class, 'thirdLogin']);// 第三方登录
Route::post('passport/loginWxPhone', [\App\Http\Controllers\Api\v1\PassportController::class, 'loginWxPhone']);
Route::post('sms/send', [\App\Http\Controllers\Api\v1\SmsController::class, 'send']);// 发送验证码
Route::post('sms/check', [\App\Http\Controllers\Api\v1\SmsController::class, 'check']);// 验证码校验
Route::post('user/password/retrieve', [\App\Http\Controllers\Api\v1\UserController::class, 'passwordRetrieve']);//找回密码

// 站点信息
Route::get('common/siteInfo', [\App\Http\Controllers\Api\v1\CommonController::class, 'siteInfo']);

// 登录权限
Route::group(['middleware' => ['api.sign']], function () {
    // 用户基本信息
    Route::post('user/info', [\App\Http\Controllers\Api\v1\UserController::class, 'info']);
    Route::post('user/info/update', [\App\Http\Controllers\Api\v1\UserController::class, 'infoUpdate']);
    Route::post('user/password/update', [\App\Http\Controllers\Api\v1\UserController::class, 'passwordUpdate']);


    // 支付示例
    Route::post('payment/wxMiniPayV3', [\App\Http\Controllers\Api\v1\PaymentController::class, 'wxMiniPayV3']);// 微信支付v3
    Route::post('payment/wxAppPayV3', [\App\Http\Controllers\Api\v1\PaymentController::class, 'wxAppPayV3']);// 微信App支付v3
    Route::post('payment/wxH5PayV3', [\App\Http\Controllers\Api\v1\PaymentController::class, 'wxH5PayV3']);// 微信H5支付v3
});
